﻿using System;
using System.Windows.Forms;

namespace UIapp.Controles
{
    public partial class ctrPrintTo : UserControl
    {
        public ctrPrintTo()
        {
            InitializeComponent();
        }
        string frmName;
        public void Load(string frmName)
        {
            this.frmName = frmName;
            switch (frmName)
            {
                case "frmFacturas":
                    this.cmbPrint.SelectedIndex = Properties.Settings.Default.FacturasPrintTo;
                    break;
                case "frmNc":
                    this.cmbPrint.SelectedIndex = Properties.Settings.Default.NcPrintTo;
                    break;
                case "frmCotizaciones":
                    this.cmbPrint.SelectedIndex = Properties.Settings.Default.CotizacionesPrintTo;
                    break;
            }
        }
        private void cmbPrint_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (frmName)
            {
                case "frmFacturas":
                    Properties.Settings.Default.FacturasPrintTo = this.cmbPrint.SelectedIndex;
                    break;
                case "frmNc":
                    Properties.Settings.Default.NcPrintTo = this.cmbPrint.SelectedIndex;
                    break;
                case "frmCotizaciones":
                    Properties.Settings.Default.CotizacionesPrintTo = this.cmbPrint.SelectedIndex;
                    break;
            }
        }
    }
}
